<template>
    <div class="technical-review-box">
        <!-- <a-tabs v-model:activeKey="tabsModeValue">
            <a-tab-pane key="人员和文件信息" tab="人员和文件信息"> -->
                <a-collapse v-model:activeKey="activeKeyArr" class="tabs-collapse-box">
                    <a-collapse-panel key="8" header="企业补齐补正内部审核栏" class="collapse-panel-head-l380">
                        <a-collapse v-model:activeKey="activeKeyArr" class="collapse-original">
                            <a-collapse-panel key="9" header="补正通知审批流程" class="collapse-panel-head-l255">
                                <commpVxeTable
                                    :key="refreshTable"
                                    ref="headmanVxeTable"
                                    :config="repairPageConfig" 
                                    :columns="repairPagecolumnsVxe" 
                                    :formItem="[]"
                                    :adaptiveHeight="true"
                                >
                                    <template v-slot:name_fslsj="{row}" data-desc="自定操作栏">
                                        <span>{{ timeProcessing(row.fslsj) }}</span>
                                    </template>
                                    <template v-slot:name_fblzt="{row}" data-desc="自定操作栏">
                                        <span style="color: rgb(211, 51, 51);">{{ row.fblzt }}</span>
                                    </template>
                                    <template v-slot:name_ffssj="{row}" data-desc="自定操作栏">
                                        <span>{{ row.ffssj }}</span>
                                    </template>
                                </commpVxeTable>
                            </a-collapse-panel>
                            <a-collapse-panel key="11" :header="'补齐补正材料'">
                                <commpVxeTable
                                    :key="refreshTable"
                                    ref="headmanVxeTable"
                                    :config="repairConfig" 
                                    :columns="repairColumns" 
                                    :formItem="[]"
                                    :adaptiveHeight="true"
                                    @checkboxChange="programmeCheckboxChange"
                                > 
                                    <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                    </template>
                                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                        <a-form layout="inline" >
                                            <a-form-item class="vxe-table-box-w">
                                                <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                            </a-form-item>
                                            <!-- <a-form-item>
                                                <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'补齐补正材料')" >选择模板</a-button>
                                            </a-form-item>
                                            <a-form-item v-if="editMode == '服务端模式'">
                                                <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                            </a-form-item>
                                            <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                                <a-button class="blue-btn" type="primary" @click="producerEdit(row)" >编辑</a-button>
                                            </a-form-item>
                                            <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                    <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row)" >重新编辑</a-button>
                                            </a-form-item>
                                            <a-form-item class="vxe-table-box-w">
                                                <a-button class="red-btn" type="primary" @click="producerDelete(row)" >删除</a-button>
                                            </a-form-item>
                                            <a-form-item class="vxe-table-box-w">
                                                <a-upload style="display: inline-block;" :beforeUpload="producerBeforeUpload" action="" @change="producerUpload($event,row)">
                                                    <a-button class="blue-btn" type="primary">上传</a-button>
                                                </a-upload>
                                            </a-form-item> -->
                                            <a-form-item class="vxe-table-box-w">
                                                <a-button class="blue-btn" type="primary" @click="producerDownload(row)" >下载</a-button>
                                            </a-form-item>
                                        </a-form>
                                    </template>
                                </commpVxeTable>

                            </a-collapse-panel>
                        </a-collapse>
                    </a-collapse-panel>
                </a-collapse>
            <!-- </a-tab-pane>
        </a-tabs> -->
        <a-modal
            title="编辑信息"
            :visible="disagreeVisible"
            :confirm-loading="disagreeLoading"
            @ok="disagreeHandleOk"
            @cancel="disagreeVisible = false"
        >
            <a-form layout="inline">
                <a-form-item label="电话" class="form-item-len">
                    <a-input
                        placeholder="请输入电话"
                        v-model:value="messageForm.fphone"
                    />
                </a-form-item>
                <a-form-item label="邮箱" class="form-item-len">
                    <a-input
                        placeholder="请输入邮箱"
                        v-model:value="messageForm.femail"
                    />
                </a-form-item>
            </a-form>
            
        </a-modal>
        <a-modal
            title="意见"
            v-model:visible="ideaVisible"
            @ok="ideaHandleOk"
            class="idea-modal-box"
            @cancel="ideaVisible = false"
        >
            <a-form layout="inline">
                <a-form-item :label="ideaType" class="pull-input-w">
                    <div style="display: flex;align-items: center;">
                        <vxe-textarea
                        rows="3" 
                        @focus="recordCommentsFocus" 
                        @blur="recordCommentsBlur" 
                        @change="recordCommentsChange"  
                        v-model="opinionsText" 
                        placeholder="请输入或选择意见" 
                        suffix-icon="vxe-icon-search"></vxe-textarea>
                        <a-button style="margin-left: 15px;" class="blue-btn"  type="primary" @click.stop="saveComments" >保存</a-button>
                    </div>
                    <!-- <vxe-input @focus="recordCommentsFocus" @blur="recordCommentsBlur" @change="recordCommentsChange"  v-model:value="opinionsText" placeholder="请输入或选择办理意见" suffix-icon="vxe-icon-search"></vxe-input> -->
                    <div class="opinion-record-box" v-show="isRecordComments">
                        <div v-if="opinionsList.length" class="content-box">
                            <div v-for="(item,index) in opinionsList" class="content-for">
                                <div @click.stop="selectIdea(item)"  class="content-item">
                                    <span class="content-text">{{ item.fcontent }}</span>
                                    <a-button class="red-btn" size="small" type="primary" @click.stop="deleteIdea(item)" >删除</a-button>
                                </div>
                            </div>
                        </div>
                        <div class="no-data-box" v-else>暂无记录！</div>
                    </div>
                </a-form-item>
            </a-form>
        </a-modal>
        <a-modal
            :width="1000"
            title="选择人员"
            :visible="manualVisible"
            @ok="manualHandleOk"
            @cancel="manualVisible = false"
            :forceRender="true"
        >
            <div v-if="selectPersonnel">
                <commpVxeTable
                    :key="manualKey"
                    :config="manualdataTableConfig" 
                    :columns="manualcolumnsVxe" 
                    :formItem="manualformItem"
                    @checkboxChange="checkboxChange"
                    ref="acceptanceRegistrationRef"
                >
                </commpVxeTable>
            </div>
            <div v-else>
                <commpVxeTable
                    :key="modalObserverKey"
                    :config="modalObserverConfig" 
                    :columns="modalObservercolumnsVxe" 
                    :formItem="modalObserverformItem"
                    @radioChange="modalObserverRadioChange"
                    ref="observerRef"
                >
                </commpVxeTable>
            </div>
            
        </a-modal>
        <a-modal
            :width="1000"
            title="选择模板"
            :visible="selectTemplateVisible"
            @ok="selectTemplateHandleOk"
            @cancel="selectTemplateVisible = false"
            :forceRender="true"
        >
            <commpVxeTable
                :key="selectTemplateKey"
                :config="selectTemplateConfig" 
                :columns="selectTemplatecolumnsVxe" 
                :formItem="selectTemplateformItem"
                @radioChange="selectTemplateChange"
                ref="acceptanceRegistrationRef"
            >
            </commpVxeTable>
        </a-modal>
        <a-modal
            :width="300"
            title="人数"
            :visible="numberOfPeopleVisible"
            @ok="numberOfPeopleHandleOk"
            @cancel="numberOfPeopleVisible = false"
            :forceRender="true"
        >
            <a-form layout="inline" class="search-form" >
                <a-form-item label="随机选择组长人数" v-if="this.headmanRandomType == '组长'">
                    <a-input-number v-model:value="numberOfPeopleData.fzzrs" :min="0" :precision="0" />
                </a-form-item>
                <a-form-item label="随机选择组员人数" v-if="this.headmanRandomType == '组员'">
                    <a-input-number v-model:value="numberOfPeopleData.fzyrs" :min="0" :precision="0" />
                </a-form-item>
            </a-form>
            
        </a-modal>
        <serverEditing ref="serverEditingRef" @refreshChange="manualSuccess"/>
        <signatureModel ref="signatureModelRef" />
        <serverEditingView ref="serverEditingViewRef" @refreshChange="$event=>{}"/>
        <selectTemplate ref="selectTemplateRef" @selectTemplateComplete="selectTemplateComplete"/>
    </div>
</template>
<script>
import selectTemplate from '@/components/selectTemplate/selectTemplate.vue'
import serverEditingView from '@/components/comp-model-series/server-editing-view'
import signatureModel from '@/components/signature-model/signatureModel.vue'
import serverEditing from '@/components/comp-model-series/server-editing.vue'
import compSelector from '@/components/compSelector/compSelector.vue'
import {typeInput, typeNumber, typeSelect, typeCheckbox, typeRadio, } from '@/components/compSearchCriteria/ContractType'
import YchConstant from "@/api/YchConstant";
import {
    selectWjmbServe,
    uploadPdfFileById,
    getLocalFileByIdServe,
    handlingOpinionsListServe,
    addServe,
    editServe,
    addBatchIdeaServe,
    getFileTypeServe,
    deleteBatchIdeaServe,
    ocalityPostAction,
    queryYwzdYwflContent,
    deleteFileByIdServe,
    againEditPdfFile,
    initWjjlServe,
    uploadMoreTypeFileServe,
    initBzFlowWithSmscyj,
    returnSpBzFlow,
    endFlowJob

} from './service/index'
import moment from 'moment'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
// import manualSelection from './manualSelection.vue'
import assessCheckApi from './service/api'
import blobType from '@/common/blobType'
export default {
    components:{
        serverEditing,
        compSelector,
        commpVxeTable,
        signatureModel,
        serverEditingView,
        selectTemplate,
    },
    props:{
        addEdittechnicalReview:{
            type:[Array,Object],
            default: () => {},
            required:false
        }
    },
    watch:{
        addEdittechnicalReview:{
            handler (newval, oldVal) {
                if(newval){
                    //console.log('流程二参数',newval)
                    this.HandledByOptions = []
                    this.formField = JSON.parse(JSON.stringify(newval))
                    this.formField.nextNodeDbrList.forEach(item => {
                        item = {
                            value:item.dbrid,
                            label:item.dbr
                        }
                        let arr = this.HandledByOptions.filter(i=>i.value == item.dbrid)
                        if(!arr.length){
                            this.HandledByOptions.push(item)
                        }
                    });
                }
            },
            immediate: true,
            deep: true
        },
        modeValue:{
            immediate: true,
            deep: true
        },
        FieldPdf:{
            handler (newval, oldVal) {
                //console.log('当前啊存的dpf',newval)
                this.refreshTable = Date.now()
            },
            deep:true,
        }
    },
    data(){
        return{
            tabsModeValue:'人员和文件信息',
            selectPersonnel:0,
            headmanRandomNum:{},
            headmanRandomType:'',
            numberOfPeopleVisible:false,
            numberOfPeopleData:{
                fzzrs:0,
                fzyrs:0,
                fybrs:0,
            },
            selectTemplateVisible:false,
            selectTemplateKey:null,
            templateId:'',
            takeNotesId:'',
            takeNotesType:'',
            selectTemplateConfig:{
                api:assessCheckApi.queryYwflWjmbList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                selectType:'radio',
                listData:'wjmbList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            selectTemplatecolumnsVxe:[{
                    type:'radio',
                    width:60,
                },{
                    title: '模板标题', //列头显示文字
                    field: 'fmbbt',
                    key: 'fmbbt',
                },{
                    title: '模板类型', //列头显示文字
                    field: 'fmblx1',
                    key: 'fmblx1',
                }],
            selectTemplateformItem:[{
                    label: '模板标题',
                    model: 'fmbbt',
                }],
            blobType:blobType,
            routeName:this.$route.name,
            ideaVisible:false,
            nextNode:'',
            isRecordComments:false,
            opinionsList:[],
            opinionsText:'',
            form: this.$form.createForm(this, { name: 'acceptanceDealWith' }),
            spForm: this.$form.createForm(this, { name: 'acceptanceDealWithSpForm' }),
            transactForm: this.$form.createForm(this, { name: 'transactFormName' }),
            spTransactForm: this.$form.createForm(this, { name: 'spTransactFormName' }),
            fthyjForm: this.$form.createForm(this, { name: 'fthyjForm' }),
            typeRadio:typeRadio,
            typeCheckbox:typeCheckbox,
            options:[],
            selectModelkey:null,
            rules:{
                timeArr: [{
                    type:'array',
                    required: true,
                    message: '请选择审评时间',
                    trigger: 'blur',
                }],
                spTimeArr: [{
                    type:'array',
                    required: true,
                    message: '请选择审评时间',
                    trigger: 'blur',
                }],
                opinion: [{
                    required: true,
                    message: '请输入办理意见',
                    trigger: 'blur',
                }],
                fthyjInput: [{
                    required: true,
                    message: '请输入退回意见',
                    trigger: 'blur',
                }],
            },
            transactRules:{
                dbrid: [{
                    type:'array',
                    required: true,
                    message: '请选择办理人',
                    trigger: 'blur',
                }]
            },
            activeKeyArr:['1','2','3','4','5','6','7','8','9','10','11','12','13'],
            formField:{
                // fscms:'技术审评',
                // fcykssj:'',//审评开始时间
                // fcyjssj:'',//审评结束时间
                // fcyhbqy:[],//回避区域
                // fcyxzqy:[],//选择区域
                // fcyzytc:'',//专业特长
                // timeArr:[],
            },
            //组长
            dataTableConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'spzzXpjlList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            columnsVxe:[{
                title: '姓名', //列头显示文字
                field: 'fjcyxm',
                width:80,
            },{
                title: '工作单位', //列头显示文字
                field: 'fgzdw',
                // width:180,
            },{
                title: '所属区域', //列头显示文字
                field: 'fssqy',
                width:80,
            },{
                title: '所属库', //列头显示文字
                field: 'fssk',
                width:80,
            },{
                title: '联系电话', //列头显示文字
                field: 'fjcylxdh',
                width:150,
            },{
                title: '邮箱', //列头显示文字
                field: 'fjcyyx',
                width:150,
            },{
                title: '是否同意', //列头显示文字
                field: 'fsftyxp',
                width:134,
                slots: {
                // 使用插槽模板渲染
                    default: 'isAgree',
                }
            },{
                title: '不同意意见', //列头显示文字
                field: 'fbtyyy',
                width:120,
                slots: {
                // 使用插槽模板渲染
                    default: 'disagree',
                }
            },{
                title: '选择方式', //列头显示文字
                field: 'fxpfs',
                width:100,
            },{
                title: '短信发送状态', //列头显示文字
                field: 'fsmszt',
                width:120,
            }
            // ,{
            //     title: '确认短信发送时间', //列头显示文字
            //     field: 'fxpfs',
            //     width:120,
            // }
            ,{
                title: '操作',
                field: 'id',
                slots: {
                // 使用插槽模板渲染
                default: 'operation_btn',
                },
                width:350,
                fixed:'right'
            }],

            //组员
            memberConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'spzyXpjlList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            //组长和组员整合
            reviewExpertsConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'spZjList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            //补正流程
            repairPageConfig:{
                api:assessCheckApi.spbzlcflowJkPage,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            repairPagecolumnsVxe:[{
                title: '企业名称', //列头显示文字
                field: 'fqymc',
            },{
                title: '书面审查意见', //列头显示文字
                field: 'fblyj',
            },{
                title: '环节名称',
                field: 'fhjmc',
            },{
                title: '待办人',
                field: 'fdbr',
            },{
                title: '发送人',
                field: 'ffsrmc',
            },{
                title: '发送时间',
                field: 'ffssj',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_ffssj',
                },
            },{
                title: '办理状态',
                field: 'fblzt',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_fblzt',
                },
            }
            // ,{
            //     title: '操作',
            //     field: 'id',
            //     slots: {
            //     // 使用插槽模板渲染
            //     default: 'operation_btn',
            //     },
            //     width:260,
            //     fixed:'right'
            // }
            ],
            //方案
            producerConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'spfaList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            producercolumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '方案', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    }
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    }
            }],
            inspectorConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'hstzList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            inspectorColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '姓名', //列头显示文字
                    field: 'fbusmc',
                    width:120,
                },{
                    title: '专家的涵', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:300,
                fixed:'right'
            }],
            expertOpinionConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zjspyjList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            expertOpinionColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '专家意见', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                }
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            assessConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'jsspbgList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            assessColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '技术审评报告', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                }
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            observerConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'spxpxcgcydhList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            observerColumns:[{
                    title: '姓名', //列头显示文字
                    field: 'fbusmc',
                    width:120,
                },{
                    title: '观察员函', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:750,
                    fixed:'right'
            }],
            enterpriseConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'qytzsList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            enterpriseColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '企业名称', //列头显示文字
                    field: 'fbusmc',
                    width:150,
                },{
                    title: '企业通知涵', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:820,
                    fixed:'right'
            }],
            otherMaterialsConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'qtclList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview?this.addEdittechnicalReview.sqsxid:''
                }
            },
            otherMaterialsColumns:[{
                title: '材料名称', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            rectificationConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'jczgclyqList',
                paramet:{
                    sqsxid:this.addEdittechnicalReview?this.addEdittechnicalReview.sqsxid:''
                }
            },
            rectificationColumns:[{
                title: '整改材料名称', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            repairConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'5555',
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            repairColumns:[{
                title: '补齐补正材料', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                }
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            //补正通知
            correctionConfig:{
                api:assessCheckApi.querySpHcyXpList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'bztzList',
                isPdf:true,
                suffix:{
                    key:'fwjlx',
                    value:'.pdf'
                },
                paramet:{
                    sqsxid:this.addEdittechnicalReview.sqsxid
                }
            },
            correctionColumns:[{ 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                    title: '制作的函', //列头显示文字
                    field: 'fwjccmc',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'fwjccmc_slots',
                    },
                },{
                    title: '短信状态', //列头显示文字
                    field: 'fdxzt',
                    width:120,
                },{
                    title: '盖章状态', //列头显示文字
                    field: 'fgzzt',
                    width:120,
                },{
                    title: '邮箱状态', //列头显示文字
                    field: 'fyxzt',
                    width:120,
                },{
                    title: '操作',
                    field: 'id',
                    slots: {
                        // 使用插槽模板渲染
                        default: 'operation_btn',
                    },
                    width:750,
                    fixed:'right'
            }],
            compSelectorkey:null,
            modeValue:'技术审评',
            manualParameter:{},
            refreshTable:null,
            disagreeObject:{},
            disagreeVisible:false,
            disagreeLoading:false,
            disagreeCause:'',
            modelType:1,
            HandledByOptions:[],//办理人
            ideaType:'办理意见',
            messageForm:{

            },
            FieldPdf:window.localStorage.getItem('FieldPdf'),
            manualKey:null,
            manualVisible:false,
            checkboxKey:[],
            observerRadioKey:'',
            manualformItem:[
                {
                    label: '真实姓名',
                    model: 'realname',
                }
            ],
            manualcolumnsVxe:[
            { 
                type: 'checkbox', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '真实姓名', //列头显示文字
                field: 'realname',
                fixed: 'left',
            },{
                title: '工作单位', //列头显示文字
                field: 'fgzdw',
            },{
                title: '所属库', //列头显示文字
                field: 'fssk',
            },{
                title: '所属区域', //列头显示文字
                field: 'fssqy',
            },{
                title: '擅长领域',
                field: 'fszly',
            }], 
            manualdataTableConfig:{
                api: assessCheckApi.queryHcyPageList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:300,
                paramet:{},
                isIdeaText:'',
                
            },
            //观察员
            modalObserverKey:null,
            modalObserverConfig:{
                api: assessCheckApi.observerList,
                rowId: 'id',
                fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),
                height:300,
                paramet:{},
                isIdeaText:'',
            },
            modalObservercolumnsVxe:[
            { 
                type: 'radio', 
                width: 60 ,
                fixed: 'left'
            },{
                title: '观察员姓名', //列头显示文字
                field: 'fgcyxm',
                fixed: 'left',
            },{
                title: '单位名称', //列头显示文字
                field: 'fdwmc',
            },{
                title: '所属区域', //列头显示文字
                field: 'fszds',
            }], 
            modalObserverformItem:[
                {
                    label: '观察员姓名',
                    model: 'fgcyxm',
                }
            ],
            vxeOptionsArr:[],
            addEditParameter:[],
            selectFile:[],
        }
    },
    computed: {
        editMode(){
            return this.$store.state.permission.editMode
        },
    },
    mounted(){
        this.$nextTick(()=>{
            ocalityPostAction({dictName:'观察员所属地市'}).then(res=>{
                //console.log('字典的res',res)
                if(res.code == 200){
                    if(res.result.length){
                        this.vxeOptionsArr = res.result
                        // this.optionsDataChange(res.result,{label:'itemText',value:'itemValue'})
                        // this.vxeRadioKey = Date.now()
                    }
                    
                }
            })
        })
    },
    methods:{
        leadingInClick({file},type){//上传
            var that = this
            if(typeof file.uid !== 'undefined') {
                    const fileData = new FormData();
                    fileData.append("file",file);
                    fileData.append("fywflcode",this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]));
                    fileData.append("sqsxid",this.addEdittechnicalReview.sqsxid);
                    fileData.append("fwjlx1",type);
                    uploadMoreTypeFileServe(fileData).then(res => {
                        if(res.code !== 200){
                            that.$message.warning('请上传pdf文件或者联系管理员!')
                        }else{
                            that.refreshTable = Date.now()
                            that.$message.success('上传成功')
                        }
                    })
            }
        },
        timeProcessing(val){
            if(val){
                val = val.slice(0,11)
            }
            return val
        },
        goHandleClick(val){
            this.$router.push(`/medicalEquipment/reviewExperts/departmentReview/index?sqsxid=`+this.formField.sqsxid)
        },
        //选择审评时间
        timeArrChange(val,num,text){
            if(num == 1){
                this.formField.spTimeArr[0] = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.spTimeArr[1] = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
                this.formField.fspkssj = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.fspjssj = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
            }else{
                this.formField.timeArr[0] = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.timeArr[1] = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
                this.formField.fcykssj = val[0]? moment(val[0]).format('YYYY-MM-DD'):''
                this.formField.fcyjssj = val[1]? moment(val[1]).format('YYYY-MM-DD'):''
            }
            this.scenePreserveClick(text)
        },
        selectHandleChangeOny(val){
            this.scenePreserveClick(val)
        },
        checkboxChange(val){
            this.checkboxKey = []
            if(val.length){
                val.forEach(item => {
                    this.checkboxKey.push(item.id)
                });
            }
        },
        //选择观察员
        selectObserver(){
            this.observerRadioKey = ''
            this.selectPersonnel = 0
            this.manualVisible = true
            this.modalObserverKey = Date.now()
        },
        manualSuccess(){
            this.refreshTable = Date.now()
        },
        //审查组长或组员随机选
        headmanRandom(val,num){
            var that = this
            var formDataR = this.form
            if(num){
                formDataR = this.spForm
            }
            this.headmanRandomNum = num
            this.headmanRandomType = val
            if( val == 1){
                this.numberOfPeopleData.fzzrs = 1
                this.numberOfPeopleData.fzyrs = 1
            }
            formDataR.validateFields((err, values) => {
                if(!err){
                    if(num == 0){//预备审评员
                        this.numberOfPeopleHandleOk()
                    }else{
                        this.numberOfPeopleVisible = true
                        
                    }
                    
                }else{
                    this.$message.warning('请输入审评时间')
                }
            })
            
            
        },
        //不同意意见
        disagreeClick(val){
            this.disagreeObject = val
            this.disagreeCause = val.fbtyyy
            // this.disagreeVisible = true
            this.opinionsText = val.fbtyyy
            this.isIdeaText = val.fbtyyy
            this.ideaVisible = true
            this.ideaType = '选派不同意意见'
            this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
        },
        //获取方案企业基本信息等
        getBasicField(title,key){
            queryYwzdYwflContent({fzdlx1:title,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                if(res.code == 200){
                    this.formField[key] = res.result.content?res.result.content:''
                    this.$message.success(res.message)
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        //manualHandleOk
        producerMould(row,val){
            this.$refs.selectTemplateRef.getSelectTemplate(row,val,this.formField.sqsxid)
            this.$refs.selectTemplateRef.selectTemplateVisible = true
        },
        selectTemplateComplete(){
            this.manualSuccess()
        },
        selectTemplateChange(val){
            this.templateId = val.row.id
        },
        //生成记录
        generateRecord(val,num){
            if(val == '发起流程'){
                initBzFlowWithSmscyj({sqsxid:this.formField.sqsxid,smscyj:this.opinionsText,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                    if(res.code == 200){
                        this.manualSuccess()
                        this.$message.success(res.message)
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                initWjjlServe({sqsxid:this.formField.sqsxid,type:val,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                    if(res.code == 200){
                        this.manualSuccess()
                        this.$message.success(res.message)
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
            

            
        },
        //流程退回
        expertProcessReturn(val){
            //console.log(val)
            var that = this
            this.$confirm({
                title:'您确认要退回吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    returnSpBzFlow({jobid:val.jobid,fywflcode:that.flowPathParameter.fywflcode}).then(res=>{
                        if(res.code == 200){
                            that.$message.success(res.message)
                            that.manualSuccess()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        //终止
        expertProcesstErmination(row,val){
            var that = this
            this.$confirm({
                title:'您确认要终止吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    endFlowJob({jobid:row.jobid,fywflcode:that.flowPathParameter.fywflcode}).then(res=>{
                        if(res.code == 200){
                            that.$message.warning(res.message)
                            that.manualSuccess()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
            
        },
        viewClick(val){
            this.$refs.serverEditingViewRef.getData({id:val.id,fwjlx:val.fwjlx})
            this.$refs.serverEditingViewRef.serverEditingVisible = true
        },
        //查看
        lookOverClick(val){
            getFileTypeServe({id:val.id,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                if(res.code == 200){
                    if(res.result == '.pdf'){
                        window.open(
                            bootConfig[process.env.NODE_ENV].locality_ApI+YchConstant.SPZX_SPCY+'/spcySqsxWjjl/getCrossLocalFile?id='+val.id
                        )
                    }else{
                        this.$message.warning('只能查看pdf文件')
                    }
                    
                }
                
            })
            
        },
        //服务端编辑
        serverEdit(val){
            this.$refs.serverEditingRef.getData(val)
        },
        //在线编辑
        producerEdit(val){
            var that = this
            //console.log('在线编辑',val)
            if(val.fwjlx == '.pdf'){
                this.$message.warning('pdf文件无法编辑')
            }else{
                // window.localStorage.setItem('FieldPdf','0')
                // this.modelType = 2
                getFileTypeServe({id:val.id,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                    if(res.code == 200){
                        if(res.result !== '.pdf'){
                                that.$webOffice(`api/spzx-spcy/spcyRsWjmb/openWjjl?id=${val.id}`,
                            `api/spzx-spcy/spcyRsWjmb/onLineSaveWjjl?id=${val.id}`+`-name=${val.fwjlx1+val.fwjlx}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileToPdf2?id=${val.id}`+`&sqsxid=${this.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileGzToPdf2?id=${val.id}`+`&sqsxid=${this.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/againEditOutPdfFile?id=${val.id}`,
                            )
                        }else{
                            this.refreshTable = Date.now()
                            this.$message.warning('pdf文件无法编辑')
                        }
                        
                    }
                    
                })
                
            }
            
        },
        //重新编辑
        againEdit(val){
            var that = this
            this.$confirm({
                title:'您确认删除已生成的pdf重新编辑文档吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    againEditPdfFile({id:val.id,fywflcode:that.flowPathParameter.fywflcode}).then(res=>{
                        if(res.code == 200){
                            that.$webOffice(
                                `api/spzx-spcy/spcyRsWjmb/openWjjl?id=${res.result.id}`,
                                `api/spzx-spcy/spcyRsWjmb/onLineSaveWjjl?id=${res.result.id}`+`-name=${val.fwjlx1+val.fwjlx}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileToPdf2?id=${res.result.id}`+`&sqsxid=${that.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileGzToPdf2?id=${res.result.id}`+`&sqsxid=${that.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/againEditOutPdfFile?id=${res.result.id}`,
                            )
                            that.refreshTable = Date.now()
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        //方案删除
        producerDelete(val){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    deleteFileByIdServe({id:val.id,fywflcode:that.flowPathParameter.fywflcode}).then(res=>{
                        if(res.code == 200){
                            that.manualSuccess()
                            that.$message.success('删除成功')
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
            
        },
        //方案上传
        producerBeforeUpload(e){
            return false
        },
        producerUpload({file},val){//
            var that = this
            if(typeof file.uid !== 'undefined') {
                // if(file.name.indexOf(".xls") !== -1 || file.name.indexOf(".xlsx") !==-1) {
                    const fileData = new FormData();
                    fileData.append("file",file);
                    fileData.append("fywflcode",this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]));
                    fileData.append("id",val.id);
                    fileData.append("sqsxid",this.formField.sqsxid);
                    
                    uploadPdfFileById(fileData).then(res => {
                        if(res.code !== 200){
                            that.$message.warning('请上传pdf文件或者联系管理员!')
                        }else{
                            this.manualSuccess()
                            that.$message.success('上传成功')
                        }
                        
                    })
                // }
                
            }
        },
        //方案下载
        producerDownload(val){//下载模板
            var that = this
            var fileName = val.fwjccmc 
            let param = { fywflcode:this.addEdittechnicalReview.fywflcode?this.addEdittechnicalReview.fywflcode:(blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]),id:val.id,sqsxid:this.formField.sqsxid}
            
            getFileTypeServe({id:val.id,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                if(res.code == 200){
                    getLocalFileByIdServe(param).then((data) => {
                        if (!data) {
                            that.$message.warning('文件下载失败')
                        return
                        }
                        // if (typeof window.navigator.msSaveBlob !== 'undefined') {
                        //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }))
                        // } else {
                            let url = window.URL.createObjectURL(new Blob([data], { type: blobType.type[blobType.suffix.indexOf(val.fwjlx)] }))
                            let link = document.createElement('a')
                            link.style.display = 'none'
                            link.href = url
                            link.setAttribute('download', fileName + res.result)
                            document.body.appendChild(link)
                            link.click()
                            document.body.removeChild(link) //下载完成移除元素
                            window.URL.revokeObjectURL(url) //释放掉blob对象
                        // }
                    })
                }
                
            })
           
            
        },

        ideaClick(val,ideaType){
            //console.log('当前的val',val)
            // if(val == '技术审评'){
            //     // this.opinionsText = this.formField.spOpinion
            //     this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
            // }else{
            //     // this.opinionsText = this.formField.opinion
                
            // }
            this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
            this.ideaVisible = true
            this.ideaType = ideaType
            
            this.$nextTick(()=>{
                this.ideaBlur()
            })
        },
        ideaBlur(){

        },
        ideaFocusEvent(){
            this.$nextTick(()=>{
                this.ideaBlur()
            })
        },
        getHandlingOpinionsList(val,ideaType){//查询办理意见
            //console.log('查询办理意见',val,ideaType)
            handlingOpinionsListServe({ftype1:ideaType,pageNo:1,pageSize:1000,fcontent:val,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                if(res.code == 200){
                    this.opinionsList = res.result.records
                }
            })
        },
        recordCommentsChange(){
            //console.log('recordCommentsChange',this.opinionsText)
            if(this.opinionsText){
                this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
            }
            
            if(this.opinionsText){
                this.isRecordComments = true
            }else{
                this.isRecordComments = false
            }
        },
        selectIdea(val){//选择办理意见
            // if(this.ideaType === '办理意见'){
                this.opinionsText = val.fcontent
                //console.log('选择办理意见',val.fcontent)
                this.getHandlingOpinionsList(val.fcontent,this.ideaType)
                //console.log('val.fcontent')
            // }
            
            this.isRecordComments = false

        },
        recordCommentsFocus(){
            this.isRecordComments = true
        },
        recordCommentsBlur(){},
        deleteIdea(val){//删除办理意见
            deleteBatchIdeaServe({ids:val.id,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                if(res.code == 200){
                    this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        ideaHandleOk(){
            this.ideaVisible = false
            if(this.ideaType == '办理意见'){
                //console.log('555',this.modeValue)
                //console.log(this.opinionsText)
                this.formField.spOpinion = this.opinionsText
                this.spTransactForm.setFieldsValue({
                    spOpinion:this.opinionsText,
                });
                
                //console.log(this.formField.opinion)
                
            }
            if(this.ideaType == '书面审查意见'){
                this.generateRecord('发起流程')
            }
            
            
        },
        saveComments(){
            this.ideaHandleOk()
            if(this.opinionsText ){
                // (this.modeValue == '技术审评' &&this.opinionsText !== this.formField.opinion) || (this.modeValue == '技术审评' && this.opinionsText !== this.formField.spOpinion) || this.opinionsText !==this.isIdeaText
                // if (this.ideaType == '办理意见') {
                    addBatchIdeaServe({ftype1:this.ideaType,fcontent:this.opinionsText,fywflcode:this.addEdittechnicalReview.fywflcode}).then(res=>{
                        // if(res.code == 200){
                        //     this.$message.success(res.message)
                        // }else{
                        //     this.$message.warning(res.message)
                        // }
                        this.getHandlingOpinionsList(this.opinionsText,this.ideaType)
                    })
                // }
            }
        },
        //现场保存和提交
        scenePreserveClick(val){
            //console.log('保存',val)
            var that = this
            if(val == '技术审评'){
                // this.form.validateFields((err, values) => {
                    // //console.log(err)
                    // if(!err){
                        let data = {
                            jobid:that.formField.jobid,
                            sqsxid:that.formField.sqsxid, 
                            // dbrid:values.dbrid.join(','),
                            opinion:that.formField.opinion,
                            smgflag:that.formField.smgflag?'是':'否',
                            fywflcode:this.addEdittechnicalReview.fywflcode,
                            fscms:'技术审评',
                            map:{
                                fcykssj:that.formField.timeArr[0],
                                fcyjssj:that.formField.timeArr[1],
                                fcyhbqy:that.formField.fcyhbqy?that.formField.fcyhbqy.join(','):'',
                                fcyxzqy:that.formField.fcyxzqy?that.formField.fcyxzqy:'',
                                fcyzytc:that.formField.fcyzytc?that.formField.fcyzytc.join(','):'',
                                fcyjcfw:that.formField.fcyjcfw?that.formField.fcyjcfw:'',
                                fcyjcyj:that.formField.fcyjcyj?that.formField.fcyjcyj:'',
                                
                            }

                        }
                        addServe(data).then(res=>{
                            if(res.code == 200){
                                that.$emit('flowPathTwoSuccess',1)
                                that.$message.success('保存成功')
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                    // }else{
                    //     this.$message.warning('请选择审评时间')
                    // }
                // })
            }else if(val == '技术审评'){
                // this.spForm.validateFields((err, values) => {
                //     if(!err){
                        let data = {
                            jobid:that.formField.jobid,
                            sqsxid:that.formField.sqsxid,
                            // dbrid:values.dbrid.join(','),
                            opinion:that.formField.spOpinion,
                            smgflag:that.formField.spSmgflag?'是':'否',
                            fscms:'技术审评',
                            fywflcode:this.addEdittechnicalReview.fywflcode,
                            map:{
                                fspkssj:that.formField.spTimeArr[0],
                                fspjssj:that.formField.spTimeArr[1],
                                fsphbqy:that.formField.fsphbqy?that.formField.fsphbqy.join(','):'',
                                fspxzqy:that.formField.fspxzqy?that.formField.fspxzqy:'',
                                fspzytc:that.formField.fspzytc?that.formField.fspzytc.join(','):'',
                            }

                        }
                        addServe(data).then(res=>{
                            if(res.code == 200){
                                that.$emit('flowPathTwoSuccess',1)
                                that.$message.success('保存成功')
                            }else{
                                that.$message.warning(res.message)
                            }
                        })
                //     }else{
                //         this.$message.warning('请选择审评时间')
                //     }
                // })
            }
            
        },
        //提交综合评定
        comprehensiveEvaluation(val){
            var that = this
            this.spForm.validateFields((err, values) => {
                if(!err || that.formField.fsplx !== '内审'){
                    that.spTransactForm.validateFields((err2, values2) => {
                        if(values2.spOpinion){
                            let data = {}
                            data = {
                                jobid:that.formField.jobid,
                                sqsxid:that.formField.sqsxid,
                                // dbrid:values2.spDbrid.join(','),
                                opinion:values2.spOpinion,
                                smgflag:that.formField.spSmgflag?'是':'否',
                                fscms:'技术审评',
                                nextNode:'综合评定',
                                fywflcode:this.addEdittechnicalReview.fywflcode,
                                map:{
                                    fspkssj:values.spTimeArr[0],
                                    fspjssj:values.spTimeArr[1],
                                    fsphbqy:that.formField.fsphbqy?that.formField.fsphbqy.join(','):'',
                                    fspxzqy:that.formField.fspxzqy,
                                    fspzytc:that.formField.fspzytc?that.formField.fspzytc.join(','):'',
                                }

                            }
                            editServe(data).then(res=>{
                                if(res.code == 200){
                                    that.$emit('flowPathTwoSuccess')
                                    that.$message.success('提交成功')
                                }else{
                                    that.$message.warning(res.message)
                                }
                            })
                        }
                    })
                }
            })
        },

        sceneSubmitClick(val){
            //console.log('提交',val)
            var that = this
            if(val == '技术审评'){
                this.spForm.validateFields((err, values) => {
                    if(!err){
                        
                        that.spTransactForm.validateFields((err, values2) => {
                            if(!err){
                                let data = {
                                    jobid:that.formField.jobid,
                                    sqsxid:that.formField.sqsxid,
                                    dbrid:values2.spDbrid.join(','),
                                    opinion:values2.spOpinion,
                                    smgflag:that.formField.spSmgflag?'是':'否',
                                    fscms:'技术审评',
                                    fywflcode:this.addEdittechnicalReview.fywflcode,
                                    map:{
                                        fspkssj:values.spTimeArr[0],
                                        fspjssj:values.spTimeArr[1],
                                        fsphbqy:that.formField.fsphbqy?that.formField.fsphbqy.join(','):'',
                                        fspxzqy:that.formField.fspxzqy,
                                        fspzytc:that.formField.fspzytc?that.formField.fspzytc.join(','):'',
                                    }

                                }
                                editServe(data).then(res=>{
                                    if(res.code == 200){
                                        that.$emit('flowPathTwoSuccess')
                                        that.$message.success('提交成功')
                                    }else{
                                        that.$message.warning(res.message)
                                    }
                                })
                            }
                        })
                    }else{
                        this.$message.warning('请选择审评时间')
                    }
                    
                })
            }
            
        },
        programmeCheckboxChange(row){//选中方案
            if(this.selectFile.indexOf(row[0].id) == -1){
                this.selectFile.push(row[0].id)
            }else{
                this.selectFile.splice(this.selectFile.indexOf(row[0].id),1)
            }

        },
        signatureClick(){//签章
            this.$store.commit("SET_GXCADATA_NULL", [])
            if(this.selectFile.length){
                this.$refs.signatureModelRef.signatureVisible = true
                this.$refs.signatureModelRef.getSelectFile(this.selectFile)
            }else{
                this.$message.warning('请选择需要签章文件')
            }
            
        },
    }
}
</script>
<style lang="less">
.technical-review-box{
    height: calc(100vh - 142px);
    overflow-y: auto;
}
.zxqt-Upload{
    .ant-upload-list-item{
        display: none !important;
    }
}
</style>